import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/index/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/admin/logout',
    method: 'get'
  })
}
export function findPage(page) {
  return request({
    url: '/admin/user/page',
    method: 'post',
    data: page
  })
}
export function save(user) {
  return request({
    url: '/admin/user/save',
    method: 'post',
    data: user
  })
}
export function delById(id) {
  return request({
    url: '/admin/user/del/' + id,
    method: 'delete'
  })
}
export function getById(id) {
  return request({
    url: '/admin/user/getById/' + id,
    method: 'get'
  })
}
export function updateById(user) {
  return request({
    url: '/admin/user/updateById',
    method: 'put',
    data: user
  })
}
